﻿using FastGPT_Admin.Service;
using FastGPT_Admin.Setting;
using MongoDB.Bson;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FastGPT_Admin.Controller
{
    internal class TeamMembersController
    {
        private string connectionString = AppSettings.GlobalSettingsInstance.ConnectionString;
        private string databaseName = "fastgpt";
        private string collectionName = "team_members";
        private TeamMembersService _teamMembersService;

        public TeamMembersController()
        {
            _teamMembersService = new TeamMembersService(connectionString, databaseName, collectionName);
        }

        public ObjectId CreateTeamMembers(TeamMembers model)
        {
            try
            {
                ObjectId teamMembersId = _teamMembersService.Create(model);
                return teamMembersId;
            }
            catch (Exception ex)
            {
                return ObjectId.Empty;
            }
        }
    }
}
